﻿Public Class frmMain
  Private m_FormManage As FormManagement = New FormManagement(Me)
	Private Sub btnOrder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnOrder.Click
		m_FormManage.ShowForm(FormManagement.FormName.ORDERLIST)
		UpdateButtonStates()
	End Sub

	Private Sub btnMaterialManage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnMaterialManage.Click
		m_FormManage.ShowForm(FormManagement.FormName.MATERIALLIST)
		UpdateButtonStates()
	End Sub

	Private Sub btnProductManage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnProductManage.Click
		m_FormManage.ShowForm(FormManagement.FormName.PRODUCTLIST)
		UpdateButtonStates()
	End Sub

	Public Sub UpdateButtonStates()
		' Update check for all button
		rbtnOrder.Checked = False
		rbtnProductManage.Checked = False
		rbtnMaterialManage.Checked = False
		rbtnEmployeeManage.Checked = False
		rbtnCustomerManage.Checked = False

		If m_FormManage.CurrentFormName = FormManagement.FormName.ORDERLIST Then
			rbtnOrder.Checked = True
		ElseIf m_FormManage.CurrentFormName = FormManagement.FormName.PRODUCTLIST Then
			rbtnProductManage.Checked = True
		ElseIf m_FormManage.CurrentFormName = FormManagement.FormName.MATERIALLIST Then
			rbtnMaterialManage.Checked = True
		ElseIf m_FormManage.CurrentFormName = FormManagement.FormName.USERMANAGEMENT Then
			rbtnCustomerManage.Checked = True
		ElseIf m_FormManage.CurrentFormName = FormManagement.FormName.EMPLOYEELIST Then
			rbtnEmployeeManage.Checked = True
		End If
	End Sub
End Class